package template.course;

public abstract class Course {
    /**
     * 一门课程作业的流程
     */

    public final void dowork(){
        //1.布置作业
        layout();
        //2.完成作业
        write();
        //3.检查作业
        if(needCheck()){
            checkwork();
        }
    }

    protected abstract void checkwork();

    protected  boolean needCheck(){
        return  false;
    }

    private void write() {
        System.out.println("写作业");
    }

    private void layout() {
        System.out.println("布置作业");
    }


}
